<HTML>
	<HEAD>
		<TITLE></TITLE>
	</HEAD>
	<BODY>
<!-- Begin Common Doc (Swaf.Config) -->
		<p>Provides fundamental application configuration support that is easily expandable 
			to support new configuration properties.</p>
		<p>Many packages within the framework have configuration options that drive their 
			behavior at runtime. <img src="doc-files/KeyConfigPackageClassRelationships.gif" align="right">
			The config package is designed to provide centralized control of the 
			application's configuration processing which relies on <tt>ConfigHandler</tt> objects 
			to do all of the actual work. The <tt>ConfigHandler</tt> objects used by the 
			config system come from three specific areas of the appliation:
			<ol>
				<li>
					From the <tt>ConfigManager</tt>
				class in order to provide basic config file linking options.
				<li>
					From the <tt>com.Syrinx.Swaf.Application</tt> class which has hard 
					coded calls to register key framework <tt>ConfigHandler</tt>
				objects.
				<li>
					From additional <tt>ConfigPartner</tt> classes specified in the application 
					configuration file itself. Configuration extensions can easily be added by 
					creating new implementations of <tt>IConfigPartner</tt> and <tt>ConfigHandler</tt>
					from this package.</li>
			</ol>
		<P></P>
		<p>All <tt>ConfigHandler</tt> objects are actually registered through classes that 
			implement the <tt>IConfigPartner</tt> interface. <tt>IConfigPartner</tt> classes 
			can be registered in the config by adding Class elements in the ConfigPartners 
			section of the config file:</p>
		<div style="margin-left:30"
		<p class="MsoNormal" style='mso-layout-grid-align:none'><span style="FONT-SIZE:8pt;COLOR:blue;FONT-FAMILY:'Lucida Console'">&lt;</span><span style="FONT-SIZE:8pt;COLOR:maroon;FONT-FAMILY:'Lucida Console'">ConfigPartners</span><span style="FONT-SIZE:8pt;COLOR:blue;FONT-FAMILY:'Lucida Console'">&gt;<BR></span><span style="FONT-SIZE:8pt;FONT-FAMILY:'Lucida Console'"><span style='COLOR:blue'>&nbsp; &lt;</span><span style='COLOR:maroon'>Class</span><span style='COLOR:blue'>&gt;</span>[fully qualified class name]<span style='COLOR:blue'>&lt;/</span><span style='COLOR:maroon'>Class</span><span style='COLOR:blue'>&gt;<BR></span></span><span style="FONT-SIZE:8pt;COLOR:blue;FONT-FAMILY:'Lucida Console'">&lt;/</span><span style="FONT-SIZE:8pt;COLOR:maroon;FONT-FAMILY:'Lucida Console'">ConfigParners</span><span style="FONT-SIZE:8pt;COLOR:blue;FONT-FAMILY:'Lucida Console'">&gt;<o:p></o:p></span></p>
		</div>
		<p>Make sure the class names added in the ConfigPartners section actually implement the 
		<tt>IConfigPartner</tt> interface or a runtime exception of type <tt>BadConfigException</tt>
		will be thrown.
		Typically classes that need configuration options will implement the <tt>IConfigPartner</tt>
		directly, and then register anonymous inner classes that extend config handler:</p>

		<div style="margin-left:30">
		<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><b><span
		style='font-size:8.0pt;font-family:"Courier New";color:#7F0055;background:white;
		mso-highlight:white'>public</span></b><span style='font-size:8.0pt;font-family:
		"Courier New";background:white;mso-highlight:white'> <b><span style='color:
		#7F0055'>void</span></b> <span style='color:black'>registerConfigHandlers(ConfigManager</span>
		<span style='color:black'>configMgr)</span> <span style='color:black'>{<br>
		<span style='mso-spacerun:yes'> </span>configMgr.regHandler(</span><span
		style='color:#2A00FF'>&quot;... &lt;Element&gt; &lt;ConfigPath&gt;&quot;</span><span
		style='color:black'>,</span> <br>
		<span style='mso-spacerun:yes'> </span><b><span style='color:#7F0055'>new</span></b>
		<span style='color:black'>ConfigHandler()</span> <span style='color:black'>{<br>
		</span><span style='mso-spacerun:yes'> </span><b><span style='color:#7F0055'>public</span></b>
		<b><span style='color:#7F0055'>void</span></b> <span style='color:black'>executeBefore(FastMap</span>
		<span style='color:black'>context,</span> <span style='color:black'>String</span>
		<span style='color:black'>path,<br>
		<span style='mso-spacerun:yes'> </span>Element</span>
		<span style='color:black'>n)</span> <b><span style='color:#7F0055'>throws</span></b>
		<span style='color:black'>BadConfigException</span> <span style='color:black'>{<br>
		<span style='mso-spacerun:yes'> </span>legalAttributes(context,path,n,</span><span
		style='color:#2A00FF'>&quot;|id&quot;</span><span style='color:black'>);<br>
		<span style='mso-spacerun:yes'> </span></span><span style='color:#339966'>//Do
		something with the XML Element object properties to configure</span><span
		style='color:black'><br>
		<span style='mso-spacerun:yes'> </span>}<br>
		<span style='mso-spacerun:yes'> </span>});</span></span><span
		style='font-size:8.0pt;font-family:"Courier New";color:black'><br>
		}<span style='background:white;mso-highlight:white'><o:p></o:p></span></span></p>
		</div>
	<!-- End Common Doc -->
	</BODY>
</HTML>

